import request from '@/utils/request'
// 房产列表
export function getProperties(params) {
  return request({
    url: '/properties',
    method: 'GET',
    params
  })
}
// 获取指定房产
export function getPropertyDetailByID(id) {
  return request({
    url: `/properties/${id}`,
    method: 'GET'
  })
}

// 新增
export function addProperty(data) {
  return request({
    url: '/properties',
    method: 'POST',
    data
  })
}
// 编辑
export function editProperty(data) {
  return request({
    url: `/properties/${data.id}`,
    method: 'PUT',
    data
  })
}
// 删除
export function deleteProperty(id) {
  return request({
    url: `/properties/${id}`,
    method: 'DELETE'
  })
}
// 获取经济数据
export function getAgent(params) {
  return request({
    url: '/agents',
    params
  })
}
// 获取分类列表数据
export function getCategory(params) {
  return request({
    url: '/categories',
    params
  })
}

export function getPropertyCount(params) {
  return request({
    url: '/properties/count',
    method: 'get',
    params
  })
}
